Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Healing item not working nor printing anything?

Asked by
Donut792 216 Moderation Voter
6 years ago

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)

0
Connect must be "connect" retrobricks 162 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

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)

0
oh alright thank you i didnt think you were supposed to use connect do to its deprecation Donut792 216 — 6y
0
No problem. retrobricks 162 — 6y
0
oof still nothing server sided or client sided Donut792 216 — 6y
0
Hmmmm retrobricks 162 — 6y
View all comments (4 more)
0
Is the script in ServerScriptService? retrobricks 162 — 6y
0
Watch this, it may help: https://www.youtube.com/watch?v=4Dc_bri9mjs retrobricks 162 — 6y
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 Donut792 216 — 6y
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 Donut792 216 — 6y
Ad

Answer this question