I want to make it where if a player has this int value you can’t run the rest of the script. However, when the player doesn’t have the value, the player is unable to run the rest of the script. So basically if the player doesn’t have the “Quest” value then they should be able to print, however, that is not the case here.
if player:FindFirstChild("Quest") then return end
print("1")
Exactly but for some reason i cant run the script even when i dont have the “Quest” value. I want it where if u have the “Quest” Value then the script will stop
script.Parent.MouseClick:Connect(function(player)
if player:FindFirstChild("Quest") then return end
print("1")
script.Parent.MouseClick:Connect(function(player)
if player:FindFirstChild("Quest") then
print("Player has quest")
else
print("Player does not have quest")
end
end)
You need to denote player and add a suitable function to call return end in:
game.Players.PlayerAdded:Connect(function(player)
if player:WaitForChild("Quest") then
print("1")
else
print("nil")
end
end)
As shown here, it waits until a player has joined, then if they have Quest, it prints 1 and if they don’t, it prints nil. Use a PlayerAdded function before adding mouseClick, just to see if it actually works.
Just putting ..Parent.MouseClick won’t work, because there is no ClickDetector associated with it.
So basically the script makes a quest value then if u already have a quest value then u cant get another one. Because whats happening is that i can spam click the npc and get multiple quest values