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

Why won't my boolValue change even though it takes away gold from the player?

Asked by 3 years ago

local RaftBoughtValue = Player.IsRaftBought.IsRaftBoughtValue.Value

***if RaftBoughtValue == false and Player.leaderstats.gold.Value >= 50 then
    RaftBoughtValue = true
end***

if RaftBoughtValue == true then
    Player.leaderstats.gold.Value = Player.leaderstats.gold.Value - game.ReplicatedStorage.Boats.Raft.Price.Value
end


if BoatNearby == false and Player.IsRaftBought.IsRaftBoughtValue.Value == true then
    local raft = game.ReplicatedStorage.Boats.Raft:Clone()
    raft.Parent = workspace
    raft:WaitForChild("Body").Position = Vector3.new(-8.077, -1.008, -125.226)
    raft:MakeJoints()
end 

BoatNearby = false

end)

I have all values set up in the explorer and a data store ready for the boolValue. A click detector function has also been made.

1 answer

Log in to vote
0
Answered by 3 years ago

Nevermind I fixed it 2 minutes after posting this.

Ad

Answer this question