Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why does this only work for 1 player?

script.Parent.MouseButton1Click:connect(function()
	local player = script.Parent.Parent.Parent.Parent
	local char = player.Character
	local human = char:FindFirstChild("Humanoid")
	local model = script.Parent.Parent.Model.Value
	local car = script.Parent.Parent.Car.Value
	if human:FindFirstChild(model)~= nil then
		print("Model Found!")
		if human:FindFirstChild(model):FindFirstChild(car) ~= nil then
			print("Car Found!")
			local body = human:FindFirstChild(model):FindFirstChild(car):GetChildren()
			for i,v in pairs (body) do
				if v.Name == "Seat" then
					v.Disabled = true
					script.Parent.Parent.Open.Visible = true
					script.Parent.Visible = false
				end
			end
		end
	end
end)

this script is in a car gui. i am using a local script for this. so basically i want this script to disabled the Seat if it is clicked. but this script only makes the Seat Disabled for 1 player for all the other players the seat is still not disabled. please help

1 answer

FilteringEnabled is set to true. Any change made by a LocalScript will only affect the Player controlling that LocalScript, aka the person who clicked the seat.

You need to use a RemoteEvent or RemoteFunction to tell the Server to Disable the Seat for everyone.

2 comments

0

can you link me with any removeevent stuff please? i am not good with remoteevents much

This discussion is preserved as it was. New answers, comments, and votes are closed.