Ive had to change the name of “ScreenStuff” so much times and it wont fix
it was working fine in my game where I test stuff but as I copied it over from that game to one place it does not work but in other places when I copy it it does
local player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SpawnCarEvent = ReplicatedStorage:WaitForChild("SpawnCar")
local DeleteCarEvent = ReplicatedStorage:WaitForChild("DeleteCar")
local carName = script.Parent.Name
local SpawnCarFrame = script.Parent.Parent.Parent.Parent.ShopMain
local open = script.Parent.Parent.Parent.Parent.spawn
local Screenhide = script.Parent.Parent.Parent.Parent.Parent.ScreenStuff
script.Parent.MouseButton1Click:Connect(function()
SpawnCarFrame:TweenPosition(UDim2.new(1, 5,0, 0),"Out","Quint",0.5,true)
open.Visible = true
Screenhide.Enabled = true
local CurrentCar = game.Workspace:FindFirstChild(player.Name .. 'sCar')
if not CurrentCar then
SpawnCarEvent:FireServer(carName)
else
if player.Character.Humanoid.SeatPart ~= nil and player.Character.Humanoid.SeatPart:IsA("VehicleSeat") then
player.Character.Humanoid.Sit = false
end
wait()
DeleteCarEvent:FireServer(CurrentCar)
SpawnCarEvent:FireServer(carName)
end
end)
local CarSpawnerFrame = script.Parent.Parent.ShopMain
local TheUi = script.Parent.Parent.Parent.ScreenStuff
local Garageicn = script.Parent.Parent.spawn
script.Parent.MouseButton1Click:Connect(function()
CarSpawnerFrame:TweenPosition(UDim2.new(0, 0,0, 0),"Out","Quint",0.5,true)
end)
script.Parent.MouseButton1Click:Connect(function()
TheUi.Enabled = false
end)
script.Parent.MouseButton1Click:Connect(function()
Garageicn.Visible = false
end)