Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I have this problem where the button doesn't fire, it's on Filtering Enabled. How do I solve this?

Asked by
uJordy 4
7 years ago
Edited by M39a9am3R 7 years ago

Now this is the script inside the button gui. I click it multiple of times but it doesn't function because I put the print above when it fires

script.Parent.MouseButton1Click:connect(function(GetCar)
    local ModelName = "ARVBE"
    script.Parent.Visible = false
    wait(.1)
    print(ModelName)
    game.ReplicatedStorage.CarSpawn:FireServer(ModelName)

end)

ServerScriptService

game.ReplicatedStorage.CarSpawn.OnServerEvent:connect(function(ModelName)
    print(ModelName)
    if ModelName == "ARVBE" then        
        local Mod = game.ServerStorage[ModelName]
        Mod.ATSWelder.Disabled = false
        local clone = Mod:clone()
        clone.Parent = workspace
        clone:MakeJoints()
    end
end)
0
Please put your code in a code block it makes it easier to read. farrizbb 465 — 7y
0
Edited for code block. M39a9am3R 3210 — 7y
0
The first parameter OnServerEvent returns is always the player. You have to define the player first in the server script, then you can define ModelName in the parameters 2nd. Troidit 253 — 7y
0
Remember that only local scripts can use FireServer() Troidit 253 — 7y

Answer this question