I made a local script inside of a tool with the intention that when a player equips the tool, it will disable a local script insiide of starter player scripts, and then also clone a different script and put the cloned script inside of starter player scritps, however this does not happen. Nothing happens. Why is this?
local Player = game.Players.LocalPlayer
local OriginalSlide = game.StarterPlayer.StarterPlayerScripts.Slide
local M4A1Slide = game.ReplicatedStorage.M4A1Slide
local M4A1Slide2 = game.StarterPlayer.StarterPlayerScripts.M4A1Slide
function onToolEquipped()
game.OriginalSlide.Disabled = true
local M4A1SlideClone = M4A1Slide:Clone()
M4A1SlideClone.parent = game.StarterPlayer.StarterPlayerScripts
end
function onToolUnequipped()
game.OriginalSlide.Disabled = false
M4A1Slide2:Destroy()
end
function onDeath()
game.OriginalSlide.Disabled = false
M4A1Slide2:Destroy()
end
script.Parent.Equipped:connect(onToolEquipped)
script.Parent.Unequipped:connect(onToolUnequipped)
Player.Died:connect(onDeath)
function onToolEquipped()
OriginalSlide.Disabled = true
local M4A1SlideClone = M4A1Slide:Clone()
M4A1SlideClone.parent = game.StarterPlayer.StarterPlayerScripts
end
function onToolUnequipped()
OriginalSlide.Disabled = false
M4A1Slide2:Destroy()
end
function onDeath()
OriginalSlide.Disabled = false
M4A1Slide2:Destroy()
end
Perhaps its because I’m banned but I put print statements right below the function onToolEquipped() line and nothing printed, which is odd because it should have printed.