Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't this changing the boolvalue to true?

So for some reason, it isn't changing the TR boolvalue anyone know why?

wait(5)
local player = game.Players.LocalPlayer
local char = player.Character
local IsOwner = char.Owner
local IsOwnerFriend = char.OwnerFriend1
local IsOwnerFriend2 = char.OwnerFriend2
local IsOwnerFriend3 = char.OwnerFriend3
local Msettings = script.Parent.Parent.Settings
local TR = game.ReplicatedStorage.TimeReset.Value
local min = game.ReplicatedStorage.Min.Value

function leftClick()
	print("Left mouse click")
	if player == IsOwner.Value or IsOwnerFriend.Value or IsOwnerFriend2.Value or IsOwnerFriend3.Value then 
	TR = true
	else
	 print("Not Owner OR Friend Of Owner")
	 	end
	end
script.Parent.MouseButton1Click:Connect(leftClick)

1 answer

✓ Accepted answer

When you refer to a numbervalue, intvalue, stringvalue, etc.. and are trying to change it.

DO NOT assign a variable to it's value, and then try to change it, because then you are trying to change that variable, not the actual value.

Basically what you need to do to fix that is to make

local TR = game.ReplicatedStorage.TimeReset

And then when assigning it make it

TR.Value = true

Hope this helps. If you have any questions please let me know.

2 comments

0

This is why we don’t use Value Objects

0

oh... Wow I should have known thank you :)

This discussion is preserved as it was. New answers, comments, and votes are closed.