You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? leaderstats increased when part is touched with morph
-
What is the issue? with the morph the leaderstats wont increase when the part is touched
-
What solutions have you tried so far? tried to look in the script but I have no idea what’s the problem
I followed GnomeCode’s tutorial on how to rig and animate custom characters but when the morph touches the part that is supposed to increase the leaderstats it doesn’t increase.
local part = script.Parent
local canGet = true
local function ontouch(otherPart)
local humanoid = otherPart.Parent:FindFirstChild('Humanoid')
if humanoid then
local player = game.Players:FindFirstChild(otherPart.Parent.Name)
if player and canGet then
canGet = false
player.leaderstats.Souls.Value = player.leaderstats.Souls.Value + 1
wait(1)
canGet = true
end
end
end
part.Touched:Connect(ontouch)
this is the script that increases the leaderstats when touched