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

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

Asked by 2 years ago
Edited 2 years ago

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

Log in to vote
0
Answered by 2 years ago

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

Ad
Log in to vote
0
Answered by 2 years ago

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

0
Also you can try both type of scripts theking66hayday 841 — 2y
0
it didn't work what i wanted is that if someone said something then every part in workspace would unanchor Yodadthin 2 — 2y
0
Oh ok then why in your scripts there is nothing about chat service theking66hayday 841 — 2y

Answer this question