local button = script.Parent local client = game:GetService("Players").LocalPlayer local character = client.Character or client.CharacterAdded:Wait() local no = game.ServerStorage.Sound local clone = no:Clone() clone.Parent = character.Head local sound = character.Head:WaitForChild("Sound") button.Activated:Connect(function() if not sound.IsPlaying then character.Humanoid.WalkSpeed = 90 sound:Play() sound.Looped = true button.Text = 'SLOW DOWN!' else character.Humanoid.WalkSpeed = 16 sound:Stop() sound.Looped = false button.Text = 'RUN FAST!' end end)
This script doesn't create errors, it just doesn't work. It is meant to insert a sound into a player, then play it when they click it.
ServerStorage is a service. It should be called by
game:GetService("ServerStorage")
and not
game.ServerStorage
Firstly I recommend using ReplicatedStorage instead of ServerStorage for items that localscripts require. For example:
local repStorage = game:GetService("ReplicatedStorage") local sound = repStorage:WaitForChild("Sound")
Otherwise, I believe the rest of the script should function correctly.