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

Tool works in studio, but in ROBLOX, it says ClickedEvent isn't there?

Asked by
Admin8483 -21
7 years ago
Edited 7 years ago

So, I have a tool that has the children of "Local Script", "ClickEvent", and "Script".

But, whenever I go into ROBLOX and join the game, I get the tool, but it says that ClickEvent is not a child of the tool. Here is the clone script:

gps = game:GetService("GamePassService");


Tools = {"TNTTool"} -- Exact text--

Respawn_With_Tools = true;  -- False if you don't want the people spawned with it.
--MAKE SURE YOU PUT THE TOOLS IN THE LIGHTING
id = script:WaitForChild("GamePassID"); -- Do not change
game.Players.PlayerAdded:connect(function(Player)
Player:WaitForDataReady()
if gps:PlayerHasPass(Player , id.Value) then
for i,v in pairs (game.Lighting:GetChildren()) do
for a,c in ipairs (Tools) do
if v:IsA'Tool' and v.Name:lower()==c:lower() then
local adminTool = v:Clone()
if Respawn_With_Tools==true then
adminTool.Parent=Player.StarterGear
adminTool:Clone().Parent=Player.Backpack
elseif Respawn_With_Tools==false then
adminTool.Parent = Player.Backpack
end
end
end
end
end
end)

Note: I own the gamepass and the name is spelt correctly, and I have a value in the script for the gamepass.

0
There is nothing named ClickEvent in the script you posted. The problem would be in the tool script, not this. Either way, the tool script can't find that Instance. Using WaitForChild() would probably fix it. Azarth 3141 — 7y
0
Never mind. It was the wrong script and ROBLOX fixed it anyway. Sorry XD Admin8483 -21 — 7y

Answer this question