Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if _G.Executed == false or _G.Executed == nil then
- _G.Executed = true
- Spawned = false
- Spawning = false
- SpawnPad = nil
- workspace.PlayerModels.ChildAdded:connect(function(Added)
- if Spawned == false and Spawning == false then
- Owner = nil
- CheckTries = 0
- CheckSuccess = false
- repeat
- wait()
- CheckTries = CheckTries + 1
- if Added:FindFirstChild("Owner") and Added:FindFirstChild("Type") and Added.Type.Value == "Vehicle" and Added:FindFirstChild("Settings") and Added.Settings:FindFirstChild("Color") then
- CheckSuccess = true
- Owner = Added.Owner.Value
- end
- until CheckTries == 75 or CheckSuccess == true
- if Owner == game.Players.LocalPlayer or game.ReplicatedStorage.Interaction.ClientIsWhitelisted:InvokeServer(Owner) == true then
- Spawning = true
- Added:WaitForChild("Settings")
- Added.Settings:WaitForChild("Color")
- print(tostring(Added.Settings.Color.Value))
- if tostring(Added.Settings.Color.Value) == tostring(1032) then
- Spawned = true
- Spawning = false
- print(Spawned)
- elseif tostring(Added.Settings.Color.Value) ~= tostring(1032) then
- if SpawnPad:FindFirstChild("ButtonRemote_SpawnButton") and SpawnPad:FindFirstChild("Owner") then
- if SpawnPad.Owner.Value == game.Players.LocalPlayer or game.ReplicatedStorage.Interaction.ClientIsWhitelisted:InvokeServer(SpawnPad.Owner.Value) == true then
- Spawning = false
- warn(game.ReplicatedStorage.Interaction.RemoteProxy:FireServer(SpawnPad.ButtonRemote_SpawnButton))
- Spawning = false
- end
- end
- end
- end
- end
- end)
- mouse = game.Players.LocalPlayer:GetMouse()
- mouse.KeyDown:connect(function(key)
- if key:lower() == "c" then
- if mouse.Target.Parent:FindFirstChild("ButtonRemote_SpawnButton") then
- SpawnPad = mouse.Target.Parent
- Spawned = false
- Spawning = false
- game.ReplicatedStorage.Interaction.RemoteProxy:FireServer(mouse.Target.Parent.ButtonRemote_SpawnButton)
- else
- Spawned = true
- Spawning = false
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement