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

local script will not run. where do i put it to make it run properly?

Asked by 5 years ago

code:

local player = game:GetService("Players").LocalPlayer
local event = game:GetService("ReplicatedStorage"):WaitForChild("ClickEvent")

local function clickEvent()
 player.PlayerGui.Hosvi.Frame.Visible = true
print("epic")
end

event.OnClientEvent:Connect(clickEvent)

It returns no errors. It does nothing.

It waits for the event to run, which it does, but then nothing happens.

0
game:GetService(‘Players’).LocalPlayer:WaitForChild(‘PlayerGui’) brok4d 77 — 5y
0
local scripts can run inside StarterGui, StarterPlayer, StarterPack, inside the players character and ReplicatedFirst User#23365 30 — 5y

3 answers

Log in to vote
0
Answered by 5 years ago

Try Putting It In StarterGui or StarterPlayerScripts

0
did not workkk SodaZere 31 — 5y
Ad
Log in to vote
0
Answered by
Launderer 343 Moderation Voter
5 years ago

I personally believe the best place to put localscripts is in the StarterPlayerScripts. Some people believe starterpack and or startergui is better. I firmly disagree with this and I will now tell you why.

Why not StarterPack

StarterPack is used for tools, not scripts. End of story.

Why not StarterGui

StarterGui is for Guis, not scripts. End of story.

Why StarterPlayerScripts

StarterPlayerScripts is for scripts, in particularly localscripts. End of story

0
i usually put mines inside StarterGui so \_(^_^)_/  User#23365 30 — 5y
Log in to vote
0
Answered by
gullet 471 Moderation Voter
5 years ago

If the script is not running it is either disabled or misplaced. The wiki lists where localscript can run:

A Player’s Backpack, such as a child of a Tool

A Player’s Player/Character|character model

A Player’s PlayerGui

A Player’s PlayerScripts.

The ReplicatedFirst service

Answer this question