Jump to content

I need a help!


Recommended Posts

Posted (edited)

도와줘. 번역기를 사용하여 문맥이 원활하지 않다는 점을 이해하십시오. 내 캐릭터 자체는 아무런 문제없이 작동했습니다. 문제는 항목입니다. 무기와 모자가 추가되었을 때 서버가 실패하기 시작했습니다. 서버가 시작되지 않습니다. 문제가 뭔가요? 나를 도울 수 있는 사람이 있습니까?

 

캡틴.zip

Edited by rukoo
I attached the wrong file.
Link to comment
Share on other sites

4 hours ago, rukoo said:

도와줘. 번역기를 사용하여 문맥이 원활하지 않다는 점을 이해하십시오. 내 캐릭터 자체는 아무런 문제없이 작동했습니다. 문제는 항목입니다. 무기와 모자가 추가되었을 때 서버가 실패하기 시작했습니다. 서버가 시작되지 않습니다. 문제가 뭔가요? 나를 도울 수 있는 사람이 있습니까?

 

캡틴.zip 4.69 MB · 1 download

I have noted the places where I have made changes for you.

Captin.zip

Link to comment
Share on other sites

Thank you very much. I don't know how to express my gratitude. Thank you for always helping me!

Can I ask you one more question? I want to make this character regain his mental strength on the ship. (If possible, I hope it works for others on the ship.)

So I referred to the tutorial. I tried to apply the code to restore my mental strength when I was with other custom characters, so I could make them recover when I was with the ship. But this did not apply. Do you know what the problem is? (;´д`)ゞ

-- DoPeriodicTask calls the given function every X seconds.
-- I set it to 1.0. You can set it to e.g. 0.5 seconds if you want.
inst:DoPeriodicTask(1.0, function(inst)
	-- Do nothing if the player is dead.
	if inst.components.health:IsDead() or inst:HasTag("playerghost") then
		return
	end
	
	-- Store the position of the player in x, y, z variables.
	local x,y,z = inst.Transform:GetWorldPosition()
	
	-- Description of important function, which finds specific entities within a range:
	-- TheSim:FindEntities(x, y, z, radius, mustHaveTags, cantHaveTags, mustHaveOneOfTheseTags)
	
	-- We have limited it to any player that is not a ghost or in limbo.
	-- I have set the radius to be the one used for standard negative auras. You can set it to whatever radius you want.
	local ents = TheSim:FindEntities(x, y, z, TUNING.SANITY_EFFECT_RANGE, {"player"}, {"playerghost", "INLIMBO"}, nil)

	for i, v in ipairs(ents) do
		if v and v:IsValid() and v.prefab == "boat" then
			inst.components.sanity:DoDelta(1, true) -- "true" disables the pulse on the badge and disables that it plays a sound.
		end
	end
end)

 

Link to comment
Share on other sites

4 hours ago, rukoo said:

Thank you very much. I don't know how to express my gratitude. Thank you for always helping me!

Can I ask you one more question? I want to make this character regain his mental strength on the ship. (If possible, I hope it works for others on the ship.)

So I referred to the tutorial. I tried to apply the code to restore my mental strength when I was with other custom characters, so I could make them recover when I was with the ship. But this did not apply. Do you know what the problem is? (;´д`)ゞ

-- DoPeriodicTask calls the given function every X seconds.
-- I set it to 1.0. You can set it to e.g. 0.5 seconds if you want.
inst:DoPeriodicTask(1.0, function(inst)
	-- Do nothing if the player is dead.
	if inst.components.health:IsDead() or inst:HasTag("playerghost") then
		return
	end
	
	-- Store the position of the player in x, y, z variables.
	local x,y,z = inst.Transform:GetWorldPosition()
	
	-- Description of important function, which finds specific entities within a range:
	-- TheSim:FindEntities(x, y, z, radius, mustHaveTags, cantHaveTags, mustHaveOneOfTheseTags)
	
	-- We have limited it to any player that is not a ghost or in limbo.
	-- I have set the radius to be the one used for standard negative auras. You can set it to whatever radius you want.
	local ents = TheSim:FindEntities(x, y, z, TUNING.SANITY_EFFECT_RANGE, {"player"}, {"playerghost", "INLIMBO"}, nil)

	for i, v in ipairs(ents) do
		if v and v:IsValid() and v.prefab == "boat" then
			inst.components.sanity:DoDelta(1, true) -- "true" disables the pulse on the badge and disables that it plays a sound.
		end
	end
end)

 

If the player is near the boat they will recover 1 sanity every second

modmain.lua

  • Like 1
Link to comment
Share on other sites

Posted (edited)

That was very thoughtful of you! You are an angel. It solved my anxiety for a few days at once. Thank you.ヾ(≧▽≦*)o

Edited by rukoo
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...