#who i fix this
1 messages · Page 1 of 1 (latest)
There is an issue, clone:MakeJoints() remove that
** You are now Level 1! **
check if it finds ur van
who?
the code
is ur brain ok
genuinely
below where u set a variable for the van
add an if statement to check if it finds the van
can toy sent me the statement script pls?
local enabled = false
script.Parent.MouseButton1Click:Connect(function(GetCar)
if enabled == true then return end
enabled true
local Mod game.ServerStorage:WaitForChild("MafiaVan")
if not Mod then print("Can not find van!") end
local clone = Mod:Clone()
clone.Parent = workspace
wait(25)
enabled = false
end)
hold on
this i will put in the script or create a new script
some stuff wrong
ok
and i have another problem in studio my guis open but in roblox in game dosent open i dont know who to fix it help pls
local ServerStorage = game:GetService("ServerStorage")
local mod = ServerStorage.MafiaVan
local ENABLED = false
script.Parent.MouseClick:Connect(function()
if ENABLED then
return
end
ENABLED = true
local clone = mod:Clone()
clone.Parent = workspace
task.wait(25)
ENABLED = false
end)
Corrected Code
@languid prairie, is the MouseButton click GUI or a ClickDetector
bro just did what i did but made it bigger 😔
No.
Yes.
Your code is pretty terrible.
It's repetitive.
its almost like i just added an if statement and did :WaitForChild
Why would you use WaitForChild() on a serverscript?
You'd know it is wrong and not a good practice
i would say adding waitforchild would be good practice but ig yk best
Why would it be a good practice xd?
You do realize that using WaitForChild() on server gives out alot of errors.
what code have u been making where that happens?
ive not had that happen once
And you even did not reference on service on top, instead you did game, and yet again. It's not a good practice.
yeah that one ik
Your basically miss using WaitForChild()
You only use WaitForChild() on the client, not on the server.
** You are now Level 1! **
MouseButton1Click only works on the mouse not on clickdetector
what?
Your right, just checked the docs.
It's supposed to be MouseClick not MouseButton1Click.
it will be good if we add a position also
If it's client he must use it ReplicatedStorage.
because normally it will spawn the car in 0,0,0
yes by adding a remote event and a local script
Yeah and that too
He is using a ClickDetector.
Not client.
yes
if he was using mouse and for client then we can make a random system by using math.random(1,100) to make it so that if the number chosen by math.random is 1 then the car spawns on this position and other positions for the rest of the positions
what
and to make it easy we can make a table of positions also by using an array
this man struggles to create variables and you make him do arrays
