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

LocalScript CheckBox works in ROBLOX studio, but not in ROBLOX in the game?

Asked by 6 years ago
Edited 6 years ago

I've had this problem two times now (in two separate things in the same game). I have a checkbox, here's the code

checked = script.Parent.checked.Value

function CheckBox1_CheckChanged()
if checked == false then
checked = true
game.Players.LocalPlayer.Data.Test.Value = 1
script.Parent.Image = "rbxassetid://1413127588"
elseif checked == true then
game.Players.LocalPlayer.Data.Test.Value = 0
script.Parent.Image = "rbxassetid://1413106823"
checked = false
end
end

script.Parent.MouseButton1Down:connect(CheckBox1_CheckChanged)

Whenever in studio testing, it changes the image to the image it's supposed to change to (rbxassetid://1413127588), when I click on it again, it changes to nothing (That's probably normal, due to the image being moderated/loading) though if I click it again, it changes to (rbxassetid://1413127588).

When I go in-game, and try the same thing, nothing happens.

Also, I know this is off topic, but how do I instead of using an = sign for

game.Players.LocalPlayer.Data.Test.Value = 1

Make it function like

game.Players.LocalPlayer.Data.Test.Value + 1

(Using it like I used it above, doesn't work.)

0
It might be because of Filtering Enabled. I have had the same issue. dadysherwin2 155 — 6y

1 answer

Log in to vote
0
Answered by 4 years ago

uhm "Checked" is a BoolValue?

Ad

Answer this question