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

Value doesn't change client/server side?

Asked by
bnxDJ 57
4 years ago

This script is a normal script inside the server script service. The value I am trying to change is inside the player. (player service object)

--p is the player object inside the player service, not the player name.
VoteEvent.OnServerEvent:Connect(function(p)--When the vote event that comes from the client with the player object(p)
    local Players = game:GetService("Players")
    local VotedValue = p:WaitForChild("Voted")
    VotedValue.Value = true--No error but the value stays the same.
end)

thanks.

1 answer

Log in to vote
0
Answered by
gloveshun 119
4 years ago
Edited 4 years ago
VoteEvent.OnServerEvent:Connect(function(p)
   local success, errormessage = pcall(function()
    local Players = game.Players
    local VotedValue = p:WaitForChild("Voted")
    VotedValue.Value = true
    end)
if not success then
warn(errormessage) --prints what is the problem, if there's a problem
end
end)
0
It continues to do the same thing. Everything is valid but the value doesn't change client and server side for whatever reason. Thanks anyway. bnxDJ 57 — 4y
Ad

Answer this question