It works in play mode in studio, but it doesn't work ingame, please help.
The RemoteEvent is inside ReplicatedStorage.
Server Script > ServerScriptService
local RepStorage = game:GetService("ReplicatedStorage")
local Ice = RepStorage.RemoteEvents.IceMove
if Ice ~= nil then
wait(2)
Ice:FireAllClients()
end
Local Script > StarterPack
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local humroot = character.HumanoidRootPart
local RepStorage = game:GetService("ReplicatedStorage")
local Ice = RepStorage.RemoteEvents.IceMove
local deb = true
local Folder = Instance.new("Folder")
Folder.Name = "Ability Holder"
Folder.Parent = character
Ice.OnClientEvent:connect(function()
game:GetService("UserInputService").InputBegan:connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.R then
if deb then
deb = false
print("Trying to spawn it")
local x = Instance.new("Part")
x.Parent = Folder
x.Name = "Ice Punch"
x.Size = Vector3.new(3,0.6,3)
x.Position = Vector3.new(humroot.Position.X, x.Position.Y, humroot.Position.Z) + humroot.CFrame.lookVector * 20
x.Rotation = humroot.Rotation
wait()
end
deb = true
end
end)
end)

2 comments
Give me the specific locations for where the Server Script and the Local Scripts are located.
Check the script again for the locations.