Hi!
My script ere should delete a script in the player’s character, but I don’t know how to define the player.
Thanks for any help!
local sound = script.Parent.Parent.ImageLabel.Intro
local btn = script.Parent
local fade = script.Parent.Parent.Parent.fadeLoad
local plr = game.Players.LocalPlayer.Name
btn.MouseButton1Click:Connect(function()
for i = 1,500 do
wait (0.01)
sound.Volume -= 0.01
fade.BackgroundTransparency -= 0.01
end
sound:Pause()
game.Workspace.HowToIndex.CutsceneScript:Destroy()
for i = 1, 100 do
wait (0.01)
fade.BackgroundTransparency += 0.01
end
end)
btn.MouseButton1Click:Connect(function(player)
local character = player.Character
character.YourScriptNameHere:Destroy() -- whatever the name of your script is
end)
OR you can do this
wait(0.1)
local player = game.Players.LocalPlayer
local character = player.Character
btn.MouseButton1Click:Connect(function(player)
character.YourScriptNameHere:Destroy() -- whatever the name of your script is
end)
local sound = script.Parent.Parent.ImageLabel.Intro
local btn = script.Parent
local fade = script.Parent.Parent.Parent.fadeLoad
local plr = game.Players.LocalPlayer.Name
btn.MouseButton1Click:Connect(function()
for i = 1,500 do
wait (0.01)
sound.Volume -= 0.01
fade.BackgroundTransparency -= 0.01
end
sound:Pause()
plr.Character:WaitForChild("CutsceneScript"):Destroy()
for i = 1, 100 do
wait (0.01)
fade.BackgroundTransparency += 0.01
end
end)
local sound = script.Parent.Parent.ImageLabel.Intro
local btn = script.Parent
local fade = script.Parent.Parent.Parent.fadeLoad
local plr = game.Players.LocalPlayer
btn.MouseButton1Click:Connect(function()
for i = 1,500 do
wait (0.01)
sound.Volume -= 0.01
fade.BackgroundTransparency -= 0.01
end
sound:Pause()
plr.Character:WaitForChild("CutsceneScript"):Destroy()
for i = 1, 100 do
wait (0.01)
fade.BackgroundTransparency += 0.01
end
end)