Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to make a mount system where the whole server sees it?

Asked by 4 years ago

I made one, It was client sided. heres what i did

local mount = false

if mount == true then
    local view = game.ServerStorage.Mount:Clone()
    view.CFrame = game.Players.LocalPlayer.Character.Torso.CFrame
end

anyone know?

1 answer

Log in to vote
0
Answered by 4 years ago

you're gonna have to use some server sided scripting for the whole server to see it. Add a Event into your replicated storage and name it something. For example I will name it "ev" So in your local script you should have

local ev = game.ReplicatedStorage.ev
local mount = false

if mount == true then
    ev:FireServer()
end

Now your gonna have to make the server script. Server scripts can't do "Local player" but they do pick up on what player fired an even as the first piece of data sent in firing the event.

local ev = game.ReplicatedStorage.ev

ev.OnServerEvent:Connect(function(player)
    local view = game.ServerStorage.Mount:Clone()
    view.CFrame = player.Character.Torso.CFrame
end)

This should work, if not comment and I'll fix whatever error you're getting

0
It works, but i get this error: Actaully_Mine 6 — 4y
0
Never mind! it works, thank you Actaully_Mine 6 — 4y
Ad

Answer this question