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

The Script I'm using "works" inside the Studio, but not on the Roblox website ?

Asked by
devis 0
6 years ago
Edited 6 years ago

I'm using a script that makes a player able to create custom-made explosions in front of them and I need to set the center of the damage radius in front of the player creating the explosion.

I was able to make it work in the studio, even though there is an error. However, outside of the Studio (on the Roblox website), the script won't work.

My guess is that the error the Studio is giving might be the cause of it, but I have no idea how to fix it.

Here's the line that causes the error:

local center = script:WaitForChild("Creator").Value.HumanoidRootPart.CFrame * CFrame.new(0, 0, -script.ChargeTime.Value - 10)

And the error itself:

attempt to index field 'Value' (a nil value)

Note that Creator is an ObjectValue with no value. If that's what's causing the error, then how can I make it so the game detects the creator of the explosion ?

Thank you in advance !

If you need more info, just ask.

EDIT: The damage script is cloned inside another local script where the Creator object value is given a proper value.

0
If Creator is an Object Value with no value, the value would have to be a nil value. NeonicPlasma 181 — 6y
0
You can try making a script that sets the value when the player enters the game. That should fix the nil value issue. iiSpeak_Lua 35 — 6y
0
Setting the value before anything else doesn't seem to fix it. devis 0 — 6y

Answer this question