Hi there, I’m pretty new to scripting,
So i’ve got this Remote Function that is supposed to check if a Value is == or not to the Player’s name however it always returns True?, Not sure if the cause is obvious or not i’m just unware what i’ve done wrong.
Local Script:
local booth = script.Parent
local click = game.Workspace.BoothBuy.ClickDetector
local boothOwners = game.Workspace.BoothOwnersclick.MouseClick:Connect(function()
print(“You requested a Booth!”)
local isOwner = game.ReplicatedStorage.OwnerCheck:InvokeServer()
if isOwner == true then
print(“Yes”)
game.Players.LocalPlayer.PlayerGui.BoothEdit.Enabled = true
else
print(“No”)
end
end)
Script:
local booth = script.Parent
local click = game.Workspace.BoothBuy.ClickDetector
local boothOwners = game.Workspace.BoothOwnersgame.ReplicatedStorage.OwnerCheck.OnServerInvoke = function(player)
print(“Reached Server”)
for i, v in pairs(boothOwners:GetChildren()) do
if v.Name ~= player.Name then
local newOwner = Instance.new(“IntValue”)
newOwner.Name = player.Name
newOwner.Parent = boothOwners
return true
else
return false
end
end
end
Thanks,