Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is my script supposed to be a server or local script?

EDIT: I made a remote event, and 2 different scripts im trying to run an event where if u say a certain word near a brick it does not go well server sided script:

local badgeService = game:GetService("BadgeService")
local player = game.Players.LocalPlayer
local playerName = game.Players.LocalPlayer.Name
for i,v in pairs(workspace:GetChildren()) do
    if v:IsA("Model") then
        if v.Name == (playerName) then
          playerRoot = v.Torso
        end
    end
end
modelRoot = script.Parent

--get players current distance from models center part
local distance = (playerRoot.Position - modelRoot.Position).Magnitude 

--specify a radius/max distance
local radius = 15

--check to see if player is within radius
if(distance <= radius) then
    player.Chatted:Connect(function(msg)
        if msg == "Scary :o" then
            if badgeService:UserHasBadgeAsync(player.UserId,2129136841) == false then
                badgeService:AwardBadge(player.UserId,2129136841)
            end
           script.Parent.Call:FireClient(player)
        end
    end)
    print("Your close to the model")
else
    print("Your away from the model")
end

local sided script:


local player = game.Players.LocalPlayer




script.Parent.Call.OnClientEvent:Connect(function()
local h = Instance.new("Hint")
h.Parent = workspace
h.Text = "Should have not done that"
workspace.Scream:Play()
script.Parent.Decal.Transparency = 0
local f = Instance.new("Fire")
f.Parent = script.Parent
wait(4)
for i,v in pairs(workspace:GetDescendants()) do
    if v.ClassName == "BasePart" then
        v.Anchored = false
    end
end
wait(5)
player:Kick("Unexpect Client Behavior Error Code: 666")
end)

2 answers

If you are only messing with the part then use a local script if it messes with more then the part then use a normal script

This script should be a normal script. Hope this helps!!

3 comments

0

Also you can try both type of scripts

0

it didn't work what i wanted is that if someone said something then every part in workspace would unanchor

0

Oh ok then why in your scripts there is nothing about chat service

This discussion is preserved as it was. New answers, comments, and votes are closed.