Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to disable seats for the client only?

Asked by 4 years ago

I first used a local script to make seat.Disabled = true, but even when its true the player still sits. Next I tried to parent the seat to replicatedstorage. Even without the seat there on your client if the player touches it on the server it makes them sit but fall over on the ground. It seems like whatever I do on the client if the player can touch it on the server side it still applies to the player. How can i make it so the seat can be disabled for a single client?

2 answers

Log in to vote
0
Answered by 4 years ago

My current solution I have found is have the seat start in replicated storage and have the client parent it to workspace when the player joins so it only exists in each client. So when the seat is moved to replicated storage to turn it off for each client it doesn't exist in the server.

Although it seems to break the script I have within each seat and I'm not sure why. Here is the script

local seat = script.Parent


seat.Changed:Connect(function(property)
    if property ~= "Occupant" then return end 
    local occupant = seat.Occupant
    if occupant then 
        local character = occupant.Parent
            character.Animate.sit.SitAnim.AnimationId = ""
    else 
        print("offseat")
    end
end)
Ad
Log in to vote
0
Answered by 4 years ago

Hi! You could try to do, "script.Parent.Anchored = false" when you want the person to not sit, but that'll pretty much delete the seat. Other than that, all I can think of is doing, "script.Parent.Disabled = false", but you said you tried that. Hope this helps, sorry if it's not what you want!

0
unanchoring the seat will not delete it unless it has no collision. my current solution works, but my current issue is that a severscript won't run in a part that is replicated locally jamespringles 105 — 4y
0
@jamespringles, mark your answer as accepted then, if it works. PadmeOragana 78 — 4y

Answer this question