Hello, Im pretty much new to scripting, only working on morphs so far and I came across this issue where my friend gave me a fly script and I tried inserting it into one of my morphs. Apparently the Script needs to be inside the player model in workspace. I did try a few things and this is how it looks like so far
the error here seems to be that the script inside the fly script, which apparently is vital to its functinality gives this error!
Thereās not really a necessary to reference the Player via using script.Parents often
You could just reference the Player using the GetPlayerFromCharacter function the moment you call your onTouch function
Also Iād suggest adding a ādebounceā to prevent the script from firing multiple times at once:
local DB = false
local WS = workspace.Superman.Morph.Head
local RP = WS.GuiMain.Frame.Abilities
function onTouch(hit)
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player and not DB then
DB = true
local Character = hit.Parent
local r = RP.Fly:Clone()
r.Parent = Character
wait(1)
DB = false
end
end
--Connect your function to what event you want to detect