Ad
Log in to vote
0

Why did this script works in studio but no in server with no filtrering enabled?

Asked by 9 months ago
Door = script.Parent.Parent.Parent.Door
Button = script.Parent.Parent.Head

Button.ClickDetector.MouseClick:Connect(function(player)
    if player:FindFirstChild("Owned") then
        if player.Owned.Value == false then
        game.ReplicatedStorage.RemoteEvent:FireServer(player)
        Button.Parent.Parent.ClickHereToOwn.Name = (player.Name.."'s Store")
        script.Parent.Parent.Parent.CurrentOwner.Value = player.Name
        wait(1)
        Door.Parent.Parent.Shop.Name = (player.Name.."Store")
        wait(1)
        Door.Transparency = 1
        Door.CanCollide = false
        wait(5)
        script.Disabled = true
        end
    end
    end)

I am trying to do when the character click a button then the model that he clicked will change the name with the group but It doesnt do anything in server, only in studio works. Can somebody help me?

1
Is this a script or a local script? Also, where is it located? UgOsMiLy 1034 — 9mo
0
it is a script ubicated in a part which the part has clickdetector. HillsMaster 34 — 9mo
0
You cannot FireServer from a Script, only a LocalScript. You should be using a BindableEvent instead of a RemoteEvent for communicating from script --> script. BlueTaslem 16813 — 9mo
0
oh ok HillsMaster 34 — 9mo

Answer this question