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

Why does yet another simple server script of mine only work in studio...?

Asked by
PastDays 108
5 years ago
Edited 5 years ago

This script is meant to fire (which it does in studio) when hitting specifically named objects and to play a sound as well as particles when hitting them, Nothing seems that complex here so why is it yet again only working in studio?

The block this is in is stored locally (moved into the Workspace via local script).

local enabled = true
function onTouched(hit)
    if enabled == true and
        hit.Name == "Object" or hit.Name == "Barrier" then
        enabled = false
        script.Parent.Particles.Rate = 250
            local Copy = script.Particles:Clone()
            Copy.Parent = hit
            Copy.Remover.Disabled = false
            wait(0.1)
        script.Sound:Play()
        script.Parent.Particles.Rate = 0
        enabled = true
    end
end


Connection = script.Parent.Touched:Connect(onTouched)
0
moving it to workspace via a local script isn't going to replicate to the server Vulkarin 581 — 5y
0
^^^^ make it a regular script my friend CRICKET69 3 — 5y

Answer this question