Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Healing item not working nor printing anything?

the scripts are pretty self explanatory but the local does not print anything and the server doesn't play any sounds

localscript:

script.Parent.ClickDetector.MouseClick:Connect(function()
	print("clicked")
	game.ReplicatedStorage.HealingEvents.SmallHeal:FireServer()
	print("sent")
	script.Parent:Destroy()
end)

script:

game.ReplicatedStorage.HealingEvents.SmallHeal.OnServerEvent:Connect(function()
	game.Players.PlayerAdded:Connect(function(plr)
		local hum = plr.Character.Humanoid
		game.Workspace.Sounds.Crunch:Play()
		hum.Health = hum.Health + 10
	end)
end)

1 comment

0

Connect must be "connect"

1 answer

✓ Accepted answer

The answer is that Connect can not have a capital C it must be "connect".

Local:

script.Parent.ClickDetector.MouseClick:connect(function()
    print("clicked")
    game.ReplicatedStorage.HealingEvents.SmallHeal:FireServer()
    print("sent")
    script.Parent:Destroy()
end)

Server:

game.ReplicatedStorage.HealingEvents.SmallHeal.OnServerEvent:connect(function()
    game.Players.PlayerAdded:Connect(function(plr)
        local hum = plr.Character.Humanoid
        game.Workspace.Sounds.Crunch:Play()
        hum.Health = hum.Health + 10
    end)
end)

8 comments

0

oh alright thank you i didnt think you were supposed to use connect do to its deprecation

0

No problem.

0

oof still nothing server sided or client sided

0

Hmmmm

0

Is the script in ServerScriptService?

0
0

oh sorry yes the script is in ServerScriptService while the LocalScript is inside an apple that is just a mesh part that i found which is inside a Folder in workspace sorry i went off the watch YoutTube for a bit and got carried away

0

nevermind ive found out a way to click serversided and make it FireClient to change the sound id of a sound in the PlayerGui that i have already in the PlayerGui

This discussion is preserved as it was. New answers, comments, and votes are closed.