Рет қаралды 2,155
In todays video I show you how to make a GUI once clicked spawn you a car I Hope you enjoyed the video, Have a lovely rest of your day!
If you are a bit confused what to do, Feel free to message me on Discord or in the comments and Ill help you out!
Script 1
local rs = game:GetService("ReplicatedStorage")
local REs = rs.REs
local spawnEvent = REs.Spawn
script.Parent.MouseButton1Click:Connect(function(plr)
spawnEvent:FireServer(plr)
workspace.Car:Destroy()
end)
Script 2
game.Players.PlayerAdded:Connect(function(playerA)
local rs = game:GetService("ReplicatedStorage")
local REs = rs.REs
local spawnEvent = REs.Spawn
local SpawnParts = rs.SpawnParts
local Car = SpawnParts.Car
spawnEvent.OnServerEvent:Connect(function(plr)
local NewCar = Car:Clone()
local Player = game.Workspace:FindFirstChild(plr.Name)
NewCar.Parent = workspace
NewCar:MoveTo(Player.HumanoidRootPart.Position)
end)
end)
#coding #gaming #developer #scripting #lua #roblox #code #work #robloxstudio #robloxdeveloper #robloxdevelopment #development #luascript #games #game #create #sandbox #tutorial #tutorials #tutorialvideo #helping #learning #learn #learntocode2024 #learncoding #learncodingforbeginners