script.Parent.MouseButton1Click:connect(function()
	local m = script.Parent.Model.Value
	local c = script.Parent.Car.Value
	local p = script.Parent.Parent.Parent.Parent.Name
	local plr = game.Workspace:FindFirstChild(p)
	if plr ~= nil then
		plr:FindFirstChild("Humanoid")
		if plr:FindFirstChild("Humanoid") ~= nil then
			local s = plr:FindFirstChild("Humanoid"):FindFirstChild(m):FindFirstChild(c):GetChildren()
			for i,v in pairs (s) do
				if v.Name == "Seat" then
					v.Disabled = true
				end
			end				
		end
	end
end)

this is in a server script. this script is in a gui button. this script is meant to disable the seat for everyone in the game if the gui button is clicked but when i test this in 2 player roblox studio this script only disables the seat for the 'Server' it does not disable the seat for the 'Players'. why? please help me

5 comments

0

You should use a local script to run in screen GUIs and use remote events to trigger a server sided script.

0

i did use remote event earlier but that didnt work either. it had the same problem it would work on the server but not for the players

0

For line five, instead of finding the player in workspace, try using .Character on the p variable. I'm just picking out little things at a time?

0

ok

0

same thing happens. it works on the server but not for the players