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

Voting system, no error, doesn't work?

Asked by
iiKind 13
7 years ago
local value = script.Parent.Value.Value
script.Parent.Touched:connect(function(hit)
    if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
        script.Parent.Value.Value = script.Parent.Value.Value + 1
        script.Parent.SurfaceGui.TextLabel.Text = "Desert Map - " .. value
    end
end)
script.Parent.TouchEnded:connect(function(hit)
    if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then    
        script.Parent.Value.Value = script.Parent.Value.Value - 1
        script.Parent.SurfaceGui.TextLabel.Text = "Desert Map - " .. value
    end
end)

the script should change a textlabel but when a player steps on it, it doesn't do that.

0
Try "if hit.Parent:FindFirstChild("Humanoid")" instead. CherryLeaves 32 — 7y
0
on line 3, do "if hit.Parent:FindFirstChild("Humanoid") then" and on line line 9, the same thing. "if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then" doesnt do anything but create alot of lag in the syntax of the script. it messes the the system up JakePlays_TV 97 — 7y
0
tried, text didn't change, but thanks for the notice, i'll start to change the scripts from now on iiKind 13 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

on line 3, do "if hit.Parent:FindFirstChild("Humanoid") then" and on line line 9, the same thing. "if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then" doesnt do anything but create alot of lag in the syntax of the script. it messes the the system up`

if hit.Parent:FindFirstChild("Humanoid") then
Ad

Answer this question