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

Hopperbin script not working in game, works perfectly in studio. Anyone know what to do?

Asked by
Xoqex 75
10 years ago

So this happens to some of my tools, they work perfectly in studio and don't do anything in game.

I checked the output in game via developer console and got nothing.

Here's my script:

local tool = script.Parent --The hopperbin which the script is in.
local player = game.Players.LocalPlayer --The local player. (Make sure the script is a local script)
local char = player.Character --The character of the player.
local hum = char.Humanoid

tool.Selected:connect(function(mouse) --Fires the function when the event is triggered.
        mouse.Button1Down:connect(function() --Fires the function when the event is triggered.
         if char:FindFirstChild("HumanoidRootPart") ~= nil and char.HumanoidRootPart:FindFirstChild("Fire") == nil then
            local f = Instance.new("Fire", char.HumanoidRootPart)
            f.Color = Color3.new(0.4)
            f.SecondaryColor = Color3.new(0, 0, 0)
            f.Heat = 0
            f.Size = 0
            char.Torso.Anchored = true
            while (f.Size < 9.9) do
            f.Size = f.Size + 0.2
             wait(0.1)
            end
            wait(3)
            while wait(0.1) do
            f.Size = f.Size - 0.2
            if f.Size == 2 then f:Destroy() char.Torso.Anchored = false
                end
            end 
        end
    end)
end)

Any help would be appreciated.

0
It's line 10, "f.Color = Color3.new(0.4)". Color3.new has 3 arguments, not 1. You even have line 11 correct. Tkdriverx 514 — 10y
0
I updated it, and it's still not doing anything in game. Xoqex 75 — 10y

1 answer

Log in to vote
0
Answered by
Tkdriverx 514 Moderation Voter
10 years ago

Is the script a LocalScript?

0
Yes. Xoqex 75 — 10y
Ad

Answer this question