I was trying to make a “Claim Board” system but got an unexpected error.
I don’t think I could fix it. Below is my script and help is appreciated.
script.Parent.MouseButton1Click:Connect(function(plr)
if plr.Claimed.Value == true then
if plr.Name == script.Parent.Parent.Parent.Parent.Values.Owner.Value then
wait(math.random(1.5, 5))
script.Parent.Parent.Parent.Parent.Clicker.BrickColor = BrickColor.new("Lime green")
while plr.Clicked == false do
wait(0.001)
plr.Values.ReactionTime.Value += 0.001
script.Parent.Parent.Parent.Parent.Timer.SurfaceGui.TextLabel.Text = plr.Values.ReactionTime
end
end
end
end)
script.Parent.Parent.Parent.Parent.Clicker.ClickDetector.MouseClick:Connect(function(plr)
if plr.Claimed.Value == true then
if plr.Name == script.Parent.Parent.Parent.Parent.Values.Owner.Value then
plr.Clicked = true
script.Parent.Parent.Parent.Parent.Timer.SurfaceGui.TextLabel.Text = "Your Reaction Time: "..tostring(plr.Values.ReactionTime.Value)
if plr.Values.ReactionTime.Value < plr.Values.BestTime.Value then
plr.Values.BestTime.Value = plr.Values.ReactionTime.Value
plr.Values.ReactionTime.Value = 0
end
end
end
end)
Theres probably no object called “Clicked” inside the player, and you also want to make sure you’re getting the values of your objects (plr.Clicked.Value)
Mouse button 1 click doesnt return the player who clicked it. Instead you can access the player with game.Players.LocalPlayer since this is a local script. Also please assign variables instead of doing script.Parent.Parent….
Did you see my post? MouseButton1Click doesn’t return a player param. So you are editing the boolean of a nil value. Get the player with game.Players.LocalPlayer and edit that player object
UPDATE: IT HAS NO ERRORS BUT IT DOESN’T WORK.
HERE IS MY SCRIPT(CURRENT)(local script):
model = script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
local plr = game.Players.LocalPlayer
print("It is working")
if plr.Claimed.Value == true then
if plr.Name == model.Values.Owner.Value then
model.Timer.SurfaceGui.TextLabel.Text = "Wait for green..."
wait(math.random(1.5, 5))
model.Timer.SurfaceGui.TextLabel.Text = "Click the green!"
model.Clicker.BrickColor = BrickColor.new("Lime green")
while plr.Clicked.Value == false do
wait(0.001)
plr.Values.ReactionTime.Value += 0.001
end
end
end
end)
model.Clicker.ClickDetector.MouseClick:Connect(function()
local plr = game.Players.LocalPlayer
if model.Clicker.BrickColor.Color == BrickColor.new("Lime green").Color then
if plr.Claimed.Value == true then
if plr.Name == model.Values.Owner.Value then
plr.Clicked.Value = true
model.Timer.SurfaceGui.TextLabel.Text = "Your Reaction Time: "..tostring(plr.Values.ReactionTime.Value)
if plr.Values.ReactionTime.Value < plr.Values.BestTime.Value then
plr.Values.BestTime.Value = plr.Values.ReactionTime.Value
plr.Values.ReactionTime.Value = 0
end
end
end
end
end)
if your script is in workspace, it will not work, either move the script to a client environment and change the variables to work with the new path, or rewrite the script in a server environment, and keeping its current path.
Also show what your output says related to this script.